// 用户相关的接口函数
import request from '@/utils/http.js'

// 创建简历
export const addResumeAPI = (data) => {
    return request({
        url: '/student/addResume',
        method: 'post',
        data: {
            studentCertificate:data.studentCertificate,
            studentCertificateFile:data.studentCertificateFile,
            studentName: data.student_name,
            studentImgurl: data.student_imgUrl,
            studentSex: data.student_sex,
            studentAge: data.student_age,
            studentContact: data.student_contact,
            studentEmail: data.student_email,
            studentAddress: data.student_address,
            studentHighestEducation: data.student_highest_education,
            studentGraduation: data.student_graduation,
            studentMajor: data.student_major,
            studentGraduationYear: data.student_graduation_year,
            studentGpa: data.student_gpa,
            studentCampusExperience: data.student_campus_experience,
            studentInternshipCompany: data.student_internship_company,
            studentKeyResponsibilities: data.student_key_responsibilities,
            studentYearWork: data.student_year_work,
            studentSkills: data.student_skills,
            studentHonour: data.student_honour,
            studentProjects: data.student_projects,
            studentPersonal: data.student_personal,
            account: data.account,
            userRole: data.userRole,
        }
    })
}

//查询简历根据学生绑定的用户id
export const queryResumeByStudentUserIdAPI = (studentUserId) => {
    return request({
        url: '/student/queryResumeByStudentUserId',
        method: 'post',
        params: {studentUserId}
    })
}

//分页查询学生
export const pageStudentAPI = (data) => {
    return request({
        url: '/student/pageStudent',
        method: 'post',
        data: {
            studentCertificationStatus: data.studentCertificationStatus,
            pageCurrent: data.pageCurrent,
            pageSize: data.pageSize,
        }
    })
}

//修改学生信息
export const updateStudentByIdAPI = (data) => {
    return request({
        url: '/student/updateStudentById',
        method: 'post',
        data: {
            studentId: data.studentId,
            studentCertificate:data.studentCertificate,
            studentCertificateFile:data.studentCertificateFile,
            studentCertificationStatus: data.student_certification_status,
            studentCertificationRefuse:data.student_certification_refuse,
            studentName: data.student_name,
            studentImgurl: data.student_imgUrl,
            studentSex: data.student_sex,
            studentAge: data.student_age,
            studentContact: data.student_contact,
            studentEmail: data.student_email,
            studentAddress: data.student_address,
            studentHighestEducation: data.student_highest_education,
            studentGraduation: data.student_graduation,
            studentMajor: data.student_major,
            studentGraduationYear: data.student_graduation_year,
            studentGpa: data.student_gpa,
            studentCampusExperience: data.student_campus_experience,
            studentInternshipCompany: data.student_internship_company,
            studentKeyResponsibilities: data.student_key_responsibilities,
            studentYearWork: data.student_year_work,
            studentSkills: data.student_skills,
            studentHonour: data.student_honour,
            studentProjects: data.student_projects,
            studentPersonal: data.student_personal,
        }
    })
}

//删除学生
export const deleteStudentByIdAPI = (studentId) => {
    return request({
        url: '/student/deleteStudentById',
        method: 'post',
        params: {studentId}
    })
}

//根据学生id查询学生信息
export const queryStudentByIdAPI = (studentId) => {
    return request({
        url: '/student/queryStudentById',
        method: 'post',
        params: {studentId}
    })
}
